home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
stats
/
chadyn.exe
/
YSCREEN.C
< prev
next >
Wrap
Text File
|
1988-12-10
|
3KB
|
131 lines
/********************************* YSCREEN.C *********************************/
/********************* (C) 1986,7,8 by JAMES A. YORKE ************************/
/* Some of the Desmet compiler elements of this file were written
by Robert Buchal */
/* DX is a register used by MUL and DIV */
/* AH is the high byte of AX; AL is the low byte */
/* MOV moves 00000H to DX in bprint */
/* INT causes an interrupt */
/*********************************************/
#include "yinclud.h"
#ifndef MAINFRAME
#ifdef MS
#include <dos.h> /* for int86 */
#include <graph.h> /* graphics include file; see p81 MS Quick C
Prog. Guide */
int set_mode(void); /* prototype */
struct videoconfig vc; /* configuration data */
SetVidMode() { /* called in YFETCH.C and also below */
if(set_mode () == 0) {
printf("You have no identifiable graphics board.\n");
printf(
"If you have a Hercules compatible graphics board, you must run the program \n"
);
printf(
"MSHERC before running DYNAMICS. MSHERC is on the DYNAMICS distribution disk."
);
printf("\n\n");
exit(0);
}
else
_getvideoconfig(&vc);/* put videoconfig data in vc */
}
int set_mode() {
if(_setvideomode (_HERCMONO)) {
scrnrows = 348;
scrncols = 720;
numColors = 2;
return(_HERCMONO);/* 720X348 Hecules board */
}
if(_setvideomode (_VRES16COLOR)) {
scrnrows = 480;
scrncols = 640;
_setcolor((color = 3));
/* in monocrome this is fairly visible */
numColors = 16;
return(_VRES16COLOR);/* 640 X 480 16 color */
}
if(_setvideomode (_VRES2COLOR)) {
scrnrows = 480;
scrncols = 640;
numColors = 2;
return(_VRES2COLOR);/* 640 X 480 2 color */
}
if(_setvideomode (_ERESCOLOR)) {
scrnrows = 350;
scrncols = 640;
_setcolor((color = 12));/* 12 = light red */
/* doesn't work:_setbkcolor(one);This sets the background color; the command
"BLACK" sets the background back to black; "setbkcolor" sets
the background color; 1 = blue */
numColors = 16;
return(_ERESCOLOR);/* 640X350 COLOR: VGA or EGA */
}
if(_setvideomode (_ERESNOCOLOR)) {
scrnrows = 350;
scrncols = 640;
numColors = 2;
return(_ERESNOCOLOR);/* 640X350 BW: VGA or EGA */
}
if(_setvideomode (_HRESBW)) {
scrnrows = 200;
scrncols = 640;
numColors = 2;
return(_HRESBW);/* 640X200 BW: VGA, EGA, or CGA */
}
return(0);
}
int colorGraphics() { /* called using command "color" */
if(_setvideomode (_MRES256COLOR)) {
scrnrows = 200;
scrncols = 320;
numColors = 256;
return(_MRES256COLOR);/* 320 X 200,256 color,VGA or EGA */
}
if(_setvideomode (_MRES4COLOR)) {
/* = 4 means 320 x 200, 4 color */
scrnrows = 200;
scrncols = 320;
_setcolor((color = 1));
numColors = 4;
return(_ERESNOCOLOR);/* 640X350 BW: VGA or EGA */
}
return(0);
}
character_mode() { /* see command "XX" */
/* _setvideomode(_DEFAULTMODE);*/
union REGS regs; /* for int86 use */
regs.h.ah = 0;
regs.h.al = 2;
regs.x.dx = 0;
int86 (16, ®s, ®s);/* BIOS interrupt 10H; */
return;
}
#endif /* end #ifdef MS */
/************************/
#endif /* ifndef MAINFRAME */